package com.itrip.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itrip.entity.ItripUserLinkUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ItripUserLinkUserMapper extends BaseMapper<ItripUserLinkUser>{
    @Update("<script> update itrip_user_link_user\n" +
            "           <trim prefix=\"set\" suffixOverrides=\",\">\n" +
            "                    <if test=\"id != null and id!=''\">\n" +
            "                        id=#{id},\n" +
            "                    </if>\n" +
            "                    <if test=\"linkUserName != null and linkUserName!=''\">\n" +
            "                        linkUserName=#{linkUserName},\n" +
            "                    </if>\n" +
            "                    <if test=\"linkIdCard != null and linkIdCard!=''\">\n" +
            "                        linkIdCardType=#{linkIdCardType},\n" +
            "                    </if> <if test=\"linkIdCard != null and linkIdCard!=''\">\n" +
            "                        linkIdCard=#{linkIdCard},\n" +
            "                    </if>\n" +
            "                    <if test=\"linkPhone != null and linkPhone!=''\">\n" +
            "                        linkPhone=#{linkPhone},\n" +
            "                    </if>\n" +
            "                    <if test=\"userId != null and userId!=''\">\n" +
            "                        userId=#{userId},\n" +
            "                    </if>\n" +
            "                    <if test=\"creationDate != null\">\n" +
            "                        creationDate=#{creationDate},\n" +
            "                    </if>\n" +
            "                    <if test=\"createdBy != null and createdBy!=''\">\n" +
            "                        createdBy=#{createdBy},\n" +
            "                    </if>\n" +
            "                    <if test=\"modifyDate != null\">\n" +
            "                        modifyDate=#{modifyDate},\n" +
            "                    </if>\n" +
            "                    <if test=\"modifiedBy != null and modifiedBy!=''\">\n" +
            "                        modifiedBy=#{modifiedBy}\n" +
            "                    </if>\n" +
            "           </trim>\n" +
            "        where id=#{id}" +
            " </script> ")
    public Integer updateItripUserLinkUser(Map<String, Object> param);

    @Update("<script> delete from itrip_user_link_user where id in\n" +
            "    <foreach item=\"id\" collection=\"array\" open=\"(\" separator=\",\" close=\")\">\n" +
            "        #{id}\n" +
            "    </foreach> </script>")
    public Integer deleteItripUserLinkUserByIds(Long[] ids);
}
